
<form action="menu/saveOrUpdate" method="post" style="margin: 0 auto;" class="text-center"
	data-toggle="validate" data-alertmsg="false"
	data-callback="dialogCallback">
	<input type="hidden" name="menu.id" id="id" value="${menu.id!}">
	<div style="margin: 0 auto; widht: 50%; text-algin: center">
		<div style="padding-bottom: 10px;">
			<lable class="x150"> 菜单名称:</lable>
			<input type="text" name="menu.name" value="${menu.name!}"
				data-rule="required"  class="form-control ">
		</div>
		<div style="padding-bottom: 10px;">
			<lable class="x85">菜单路径:</lable>
			<input type="text" name="menu.url" value="${menu.url!}"
				  class="form-control">
		</div>

		<div style="padding-bottom: 10px;">
			<lable class="x85">&nbsp;&nbsp;&nbsp;父菜单:</lable>
			<select class="form-control " style="width:178px;"  data-width="178" name="menu.parentMenu" onchange="setParentName()" id="parentMenu" data-toggle="selectpicker" value="${menu.parentMenu!}">
		      <option value=""></option>
		      <!--:for(item in menuList){ if(item.id!=menu.id!) {-->
		      
		       <option value="${item.id}" >${item.name}</option>
		      <!--:} } -->
			</select>
			<input type="text" name="menu.parentName" id="parentName" class="hide" >
		</div>
		
		
		<div style="padding-bottom: 10px;">
			<lable class="x85">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;排序:</lable>
			<input type="text" name="menu.sort" data-rule=""
				value="${menu.sort!}" placeholder="排序号" class="form-control">
		</div>
		<div style="padding-bottom: 10px;">
			 <p class="text-center"><button type="submit" class="btn btn-default">提 交</button>
			 <!--:if(menu.id!=''){-->
             <a  class="btn btn-red" href="menu/delete/${menu.id!}" data-toggle="doajax" data-confirm-msg="确定要删除吗？" data-callback="dialogCallback">删 除</a></p>
             <!--: }  -->
		</div>
	</div>
</form>

<script type="text/javascript">


$(function(){
	$('#parentMenu').selectpicker({noneSelectedText:'请选择'});
	$('#parentMenu').selectpicker('val','${menu.parentMenu!}');
});
function setParentName(){
	  var parentName=	$('#parentMenu').find('option:selected').text();
	  $('#parentName').val(parentName);
	};
</script>